ByteData

fun ByteData(data: ByteArray, contentType: ContentType = OctetStream): ByteData
fun ByteData(data: ByteArray, contentType: ContentType = OctetStream): ByteData

Creates a new instance of ByteData with the given parameters.

Since

8.0.0

Parameters

data

The upload data as bytes.

contentType

The content type.


fun ByteData(data: String, charset: Charset = Charsets.UTF_8, contentType: ContentType = OctetStream): ByteData
fun ByteData(data: String, charset: Charset = Charsets.UTF_8, contentType: ContentType = OctetStream): ByteData

Creates a new instance of ByteData with the given parameters.

Since

8.0.0

Parameters

data

The upload data as a string.

charset

The charset used to encode data into a sequence of bytes.

contentType

The content type.